import requests
class Request:
    def __init__(self,base_url):
        self.session=requests.Session()

#url,method,必传
    def send_request(self,method,url,json=None,data=None,headers=None,params=None,**kwargs):

        # 打印请求信息
        print(f"Sending {method} request to {url}")
        if headers:
            print(f"Headers: {headers}")
        if data:
            print(f"Data: {data}")
        if params:
            print(f"Params: {params}")
        if json:
            print(f"JSON: {json}")
        response = self.session.request(method=method, url=url, headers=headers, data=data, json=json, params=params)
        print(f"Response: {response.json()}")
        # 打印响应信息
        #print(f"Response Status Code: {response.status_code}")
        #print(f"Response Headers: {response.headers}")
        #print(f"Response Content: {response.content.decode('utf-8', errors='ignore')}")
        return response








